#include "ThreadPool.hpp"
#include "Task.hpp"
#include <unistd.h>
#include <time.h>

int main()
{
    srand(time(nullptr) ^ getpid());
    ThreadPool<Task>::GetInstance()->Start();
    while(true)
    {
        int num1 = rand()%10;
        usleep(10);
        int num2 = rand()%5;
        char opt = opers[rand()%opers.size()];

        Task t(num1, num2, opt);
        ThreadPool<Task>::GetInstance()->Push(t);
        std::cout << "Main thread push a task " << t.GetTask() << std::endl;

        sleep(1);
    }
    return 0;
}